ubuntu

您所在的位置:网站首页 小米redmi airdots 2怎么切换歌曲 ubuntu

ubuntu

2023-09-07 20:26| 来源: 网络整理| 查看: 265

When you type

python3 myfile.py >myfile.html

in the terminal, it is assumed that the file myfile.py is already available in the current directory, and that myfile.html will be created in that same directory.

When you open up a new terminal window, the current directory will by default be your home directory, also known as ~ or $HOME.

However, you say that you can "see the file on your desktop", which likely means that the file is in fact in a desktop directory somewhere beneath your home directory, i.e. the file is not directly available in the home directory.

You then have a few possible alternatives.

Change directory in the terminal to where the Python script is actually located. If the desktop directory is ~/Desktop, then

cd ~/Desktop

will take you there. You may then run the python3 command as above. The myfile.html file will be created in the Desktop directory.

Move the file into your home directory. Provided that the file is located in the ~/Desktop directory, you may

mv ~/Desktop/myfile.py ~/

which will move the file. You may then proceed with the python3 command as above. The myfile.html will be created in the home directory.

Run the Python script with an complete path from the home directory:

python3 ~/Desktop/myfile.py >myfile.html

The myfile.html file will be created in the home directory.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3